package com.example.tests;


public class ContactData implements Comparable<ContactData>{
		
	private String id;
	private String firstName;
	private String lastName;
	private String address;
	private String phoneHome;
	private String phoneMobile;
	private String phoneWork;
	private String email1;
	private String email2;
	private String dayOfBirth;
	private String monthOfBirth;
	private String yearOfBirth;
	private String group;
	private String address2;
	private String phoneHome2;
	private String phoneOnMainPage;

	public ContactData() {		
	}

	
	@Override
	public String toString() {
		return "ContactData [firstName=" + firstName + ", lastName=" + lastName
				+ "]";
	}

	@Override
	public int hashCode() {
		int result = 1;
		/*final int prime = 31;
		result = prime * result
				+ ((firstName == null) ? 0 : firstName.hashCode());
		result = prime * result
				+ ((lastName == null) ? 0 : lastName.hashCode());*/
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ContactData other = (ContactData) obj;
		if (firstName == null) {
			if (other.firstName != null)
				return false;
		} else if (!firstName.equals(other.firstName))
			return false;
		if (lastName == null) {
			if (other.lastName != null)
				return false;
		} else if (!lastName.equals(other.lastName))
			return false;
		return true;
	}

	@Override
    public int compareTo(ContactData o) {
            if (this.lastName.toLowerCase().compareTo(o.lastName.toLowerCase()) == 0) {
            	return this.firstName.toLowerCase().compareTo(o.firstName.toLowerCase());
            } else 
                return this.lastName.toLowerCase().compareTo(o.lastName.toLowerCase());
    }

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}
	
	public ContactData withId(String id) {
		this.id = id;
		return this;
	}

	public ContactData withFirstName(String firstname) {
		this.firstName = firstname;
		return this;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}


	public void setLastName(String lastName) {
		this.lastName = lastName;
	}


	public void setAddress(String address) {
		this.address = address;
	}


	public void setPhoneHome(String phoneHome) {
		this.phoneHome = phoneHome;
	}


	public void setPhoneMobile(String phoneMobile) {
		this.phoneMobile = phoneMobile;
	}


	public void setPhoneWork(String phoneWork) {
		this.phoneWork = phoneWork;
	}


	public void setEmail1(String email1) {
		this.email1 = email1;
	}


	public void setEmail2(String email2) {
		this.email2 = email2;
	}


	public void setDayOfBirth(String dayOfBirth) {
		this.dayOfBirth = dayOfBirth;
	}


	public void setMonthOfBirth(String monthOfBirth) {
		this.monthOfBirth = monthOfBirth;
	}


	public void setYearOfBirth(String yearOfBirth) {
		this.yearOfBirth = yearOfBirth;
	}


	public void setGroup(String group) {
		this.group = group;
	}


	public void setAddress2(String address2) {
		this.address2 = address2;
	}


	public void setPhoneHome2(String phoneHome2) {
		this.phoneHome2 = phoneHome2;
	}


	public void setPhoneOnMainPage(String phoneOnMainPage) {
		this.phoneOnMainPage = phoneOnMainPage;
	}


	public ContactData withLastName(String lastName) {
		this.lastName = lastName;
		return this;
	}

	public ContactData withAddress(String address) {
		this.address = address;
		return this;
	}

	public ContactData withPhoneHome(String phoneHome) {
		this.phoneHome = phoneHome;
		return this;
	}

	public ContactData withPhoneMobile(String phoneMobile) {
		this.phoneMobile = phoneMobile;
		return this;
	}

	public ContactData withPhoneWork(String phoneWork) {
		this.phoneWork = phoneWork;
		return this;
	}

	public ContactData withEmail1(String email) {
		this.email1 = email;
		return this;
	}

	public ContactData withEmail2(String email) {
		this.email2 = email;
		return this;
	}
	
	public ContactData withDayOfBirth(String dayOfBirth) {
		this.dayOfBirth = dayOfBirth;
		return this;
	}

	public ContactData withMonthOfBirth(String monthOfBirth) {
		this.monthOfBirth = monthOfBirth;
		return this;
	}

	public ContactData withYearOfBirth(String yearOfBirth) {
		this.yearOfBirth = yearOfBirth;
		return this;
	}

	public ContactData withAddress2(String address) {
		this.address2 = address;
		return this;
	}

	public ContactData withPhoneHome2(String phoneHome) {
		this.phoneHome2 = phoneHome;
		return this;
	}
	
	public ContactData withPhoneOnMainPage(String phoneOnMainPage) {
		this.phoneOnMainPage = phoneOnMainPage;
		return this;
	}

	public String getFirstName() {
		return firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public String getAddress() {
		return address;
	}

	public String getPhoneHome() {
		return phoneHome;
	}

	public String getPhoneMobile() {
		return phoneMobile;
	}

	public String getPhoneWork() {
		return phoneWork;
	}

	public String getEmail1() {
		return email1;
	}

	public String getEmail2() {
		return email2;
	}

	public String getDayOfBirth() {
		return dayOfBirth;
	}

	public String getMonthOfBirth() {
		return monthOfBirth;
	}

	public String getYearOfBirth() {
		return yearOfBirth;
	}

	public String getGroup() {
		return group;
	}

	public String getAddress2() {
		return address2;
	}

	public String getPhoneHome2() {
		return phoneHome2;
	}
	
	public String getPhoneOnMainPage() {
		return phoneOnMainPage;
	}
	
}